Time

Crystal syntax.

The CTime and TimeValue functions are equivalent to Time. However, Time can only be used in Crystal syntax since it is a type name in Basic syntax.

Overloads
Arguments

Time (number)

  • Returns a Time value given a number in units of 24 hours
  • number can be fractional or negative as well

Time (string)

Returns a Time value that represents the time, given a String expression specifying a time from 0:00:00 (12:00:00 A.M.) to 23:59:59 (11:59:59 P.M.), inclusive.

Time (dateTime)

DateTime is a DateTime value.

Time (hour, min, sec)

  • Hour is a whole number representing an hour of the day.
  • Min is a whole number representing a minute.
  • Sec is a whole number representing a second.

Returns

Time Value

Action

Creates a Time value from the information provided.

Typical uses

Use this function any time you need to work with a Time value that is obtained either from a DateTime value or from the individual elements of the time (i.e. hour, minute, second).

Examples

The following examples are applicable to Crystal syntax:

Time(.2) and Time (1.2)

Both return 4:48:00 AM

Time(-.2)

Returns 7:12:00 PM

Time("3:05pm")

Returns 3:05:00 PM

Time(DateTime(1996, 1, 1, 12, 10, 10)

Returns 12:10:10.

Time(10, 20, 22)

Returns 10:20:22.

Related topics

TimeValue



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com